package cc.yugu.yhdw.webserver.service.basic;

import cc.yugu.yhdw.common.domain.basic.AgentInOutMoney;
import cc.yugu.yhdw.common.entity.pagination.Page;
import cc.yugu.yhdw.webserver.persistence.basic.AgentInOutMoneyMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
/**
 * 运营商资金流水业务
 * 
 * @Date:Created in 2018/7/3 9:39
 * @Author:
 * @Modified By: zjn 2018/7/3 9:39
 */ 
@Service
public class AgentInOutMoneyService {
    @Autowired
    AgentInOutMoneyMapper agentInOutMoneyMapper;
    /**
    * 分页查询，返回结果
    *
    * @Param: [search]
    * @Return: cc.yugu.yhdw.common.entity.pagination.Page
    * @Author By: zjn 2018/7/3  9:41
    */
    public Page findPage(AgentInOutMoney search) {
        Page page = search.buildPage();
        page.setTotalItems(agentInOutMoneyMapper.findPageCount(search));
        search.setBeginIndex(page.getOffset());
        page.setResult(agentInOutMoneyMapper.findPageResult(search));
        return page;
    }

//    public Page findPageMoney(AgentInOutMoney search) {
//        Page page = search.buildPage();
//        page.setTotalItems(agentInOutMoneyMapper.findPageCounts(search));
//        search.setBeginIndex(page.getOffset());
//        page.setResult(agentInOutMoneyMapper.findPageResults(search));
//        return page;
//    }

    /**
    * 新增：根据运营商和收入类型查询
    *
    * @Param:
    * @Return:
    * @Author By: zjn 2018/8/17  11:45
    */
    public List<AgentInOutMoney> find(Integer agentId, Integer bizType){

        List<AgentInOutMoney> list = agentInOutMoneyMapper.find(agentId,bizType);
        return list;
    }
}
